package com.example.helloworld.thread;

import android.os.Message;
import android.widget.TextView;

import com.example.helloworld.handler.TextViewChangeHandler;

public class TextViewChangeThread implements Runnable{

    private Message message;

    private TextView textView;

    public void setMessage(Message message) {
        this.message = message;
    }

    public Message getMessage() {
        return message;
    }

    public void setTextView(TextView textView) {
        this.textView = textView;
    }

    public TextView getTextView() {
        return textView;
    }

    @Override
    public void run() {
        while (true){
            if(message.what == 1 && textView != null){
                new TextViewChangeHandler(textView).handleMessage(message);
            }
        }
    }
}
